package cn.ml.io.liu;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FOSTest {
    public static void main(String[] args) {

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(new File("D:\\1_JAVA\\java_long\\basis\\src\\cn\\ml\\chuji\\io\\liu\\hello.txt"));
            String str = "天青色等烟雨，而我在等你！";
            byte[] bytes = str.getBytes();
            fos.write(bytes,0,bytes.length);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
